// https://www.youtube.com/watch?v=GCL40oJ6lvY
	
package com.fundamentalesandroid;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import java.lang.ClassNotFoundException;

public class MainActivity extends ListActivity{
	
	String pruebas[]={"LifeCycleTest","SingleTouchTest","MultiTouchTest","KeyTest",
			"AccelorometerTest","AssetsTest","ExternalStorageTest","SoundPoolTest",
			"MediaPlayerTest","FullScreenTest","RenderViewTest","FontTest","SurfaceViewTest",
			"AudioPlayer","CustomAudioPlayer","PlayerTouch","ShapeTest"};

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		this.setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,
							pruebas));
	}

	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		String nombrePrueba=this.pruebas[position];
		try {
			Class<?> clase=Class.forName("com.fundamentalesandroid."+nombrePrueba);
			Intent intent=new Intent(this,clase);
			startActivity(intent);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}	
	}
	

}